/**
 * BicycleTest.java
 * Driver for Bicycle class testing
 *
 *    Date: Nov 30, 2008
 *  Course: CS222 Java Programming II
 * Seminar: 3
 *  Assign: Inheritance Relay
 */

/**
 * BicycleTest Class
 */
public class BicycleTest {

  /**
   * Application Entry Point
   * @param args The command line arguments
   */
  public static void main(String[] args) {

    //Testing Bicyle implemntations (JT)
    Bicycle[] bicycle = new Bicycle[3];
    bicycle[0] = new MountainBike();
    bicycle[1] = new RaceBike();
    bicycle[2] = new TandemBike();

    //Display default bike stats.
    System.out.println("Default Bicycle Stats --");
    prtBikes(bicycle);

    //Accelerate each bike & display
    System.out.println("After Bicycle Acceleration --");
    accelBikes(bicycle);
    prtBikes(bicycle);

    //Apply brakes on each bike & display
    System.out.println("After Brakes Applied --");
    brakeBikes(bicycle);
    prtBikes(bicycle);

  }//End main()

  /**
   * Displays each bike in the bicycle array
   *
   * @param bicycle The array of Bikes
   */
  public static void prtBikes(Bicycle[] bicycle){
    for(Bicycle b: bicycle){
      System.out.println(b);
    }//foreach
  }//prtBikes()

  /**
   * Accelerate each bike in the bicycle array
   *
   * @param bicycle The array of bikes
   */
  public static void accelBikes(Bicycle[] bicycle){
    for(Bicycle b: bicycle){
      b.accelerate();
    }//foreach
  }//accelBikes()

  /**
   * Apply brakes on each bike in the bicycle array
   *
   * @param bicycle The array of bikes
   */
  public static void brakeBikes(Bicycle[] bicycle){
    for(Bicycle b: bicycle){
      b.brake();
    }//foreach
  }//brakeBikes()

}//End BicycleTest Class
